﻿using MediatR;
using SheepStorage.API.Application.Command.BuildingManagementCommand;
using SheepStorage.API.Application.Command.SheepWeightCommand;
using SheepStorage.API.Baseclass;
using SheepStorage.Service.DataImp;
using SheepStorage.Service.Interface;

namespace SheepStorage.API.Application.CommandHandlers.SheepWeightHandler
{
    public class SheepWeightDelRangeHandler : IRequestHandler<SheepWeightDelRangeCommand, Results<int>>
    {

        private readonly ISheepWeightService service;

        public SheepWeightDelRangeHandler(ISheepWeightService service)
        {
            this.service = service;
        }
        public async Task<Results<int>> Handle(SheepWeightDelRangeCommand request, CancellationToken cancellationToken)
        {
            var list = service.DelRangeSheepWeight(request.SheepWeightIds);
            return Results<int>.DataResult(list);
        }
    }
}
